package net.yla.smartbus.module.controller.web.ba.common;

import net.yla.smartbus.core.api.ApiResult;
import net.yla.smartbus.core.base.BaseController;
import net.yla.smartbus.module.ba.area.service.AreasService;
import net.yla.smartbus.module.ba.dept.service.DeptService;
import net.yla.smartbus.module.ba.duty.service.DutyService;
import net.yla.smartbus.module.ba.group.service.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Date: 2020-09-22 20:24
 * @Author: Being Nobody
 * @Version: 1.0
 */
@RestController
@RequestMapping("/api/web/ba/common")
public class CommonController extends BaseController {
    @Autowired
    DutyService dutyService;
    @Autowired
    DeptService deptService;
    @Autowired
    AreasService areasService;
    @Autowired
    GroupService groupService;

    /**
     * 获取职务下拉框
     *
     * @return
     */
    @PostMapping("/dutuies")
    public ApiResult dutuies() {
        String token = getToken();
        return success(dutyService.dutuies(token));
    }

    /**
     * 获取部门下拉框
     *
     * @return
     */
    @PostMapping("/departments")
    public ApiResult departments() {
        String token = getToken();
        return success(deptService.departments(token));
    }

    /**
     * 获取籍贯下拉
     *
     * @return
     */
    @PostMapping("/nativePlaces")
    public ApiResult nativePlaces() {
        String token = getToken();
        return success(areasService.nativePlaces(token));
    }

/*    *//**
     * 获取分组下拉
     *
     * @return
     *//*
    @PostMapping("/groups")
    public ApiResult groups() {
        String token = getToken();
        return success(groupService.groups(token));
    }*/

}
